package tcu.ead.leety.tcuplant.service;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import tcu.ead.leety.tcuplant.common.DataReturn;
import tcu.ead.leety.tcuplant.common.R;
import tcu.ead.leety.tcuplant.mapper.HttpControllerMapper;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Service
public class HttpService {

    @Resource
    private HttpControllerMapper httpControllerMapper;

    public R getHttpData(int id) {
        DataReturn dataReturn = httpControllerMapper.SelectData(id);
        return R.ok("tcu_tree", "1.0.0", dataReturn.getId(), dataReturn.getTid(), dataReturn.getCard(), dataReturn.getName());
    }
}
